﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using IHISCETeim.DAL;
using IHISCETeim.Model;
using IHISCETeim.Library;
using System.Data;


namespace IHISCETeim.BLL
{
    public class UFXCompletingCheckController
    {
        public static bool Add(UFXCompletingCheckInfo obj, List<UFXCompletingCheckNGInfo> NGItems)
        {
            return UFXCompletingCheckDAL.Add(obj, NGItems);
        }
        public static bool Update(UFXCompletingCheckInfo obj, List<UFXCompletingCheckNGInfo> NGItems)
        {
            Delete(obj.CCID);
            return UFXCompletingCheckDAL.Add(obj, NGItems);
        }
        public static bool Delete(int CCID)
        {
            return UFXCompletingCheckDAL.Delete(CCID);
        }
        public static UFXCompletingCheckInfo GetById(int Id)
        {
            return CBO.FillObject<UFXCompletingCheckInfo>(UFXCompletingCheckDAL.GetById(Id));
        }
        public static List<UFXCompletingCheckNGInfo> UFXCompletingCheckNG_GetById(int Id)
        {
            return CBO.FillCollection<UFXCompletingCheckNGInfo>(UFXCompletingCheckDAL.UFXCompletingCheckNG_GetById(Id));
        }
        public static DataTable GetPagination(string WhereSql, int PageIndex, int PageSize, string Sort, ref int TotalCount)
        {
            return UFXCompletingCheckDAL.GetPagination(WhereSql, PageIndex, PageSize, Sort, ref  TotalCount);
        }

        //public static DataTable OCompletingCheck_ExportNGListByDate(string FormDate, string ToDate)
        //{
        //    return OCompletingCheckDAL.OCompletingCheck_ExportNGListByDate(FormDate, ToDate);
        //}

        // /// <summary>
        ///// 判断完成检查书中，相关号码是否已存在
        ///// 1为存在，0不存在
        ///// </summary>
        ///// <returns></returns>
        //public static int OCompletingCheck_GetCheckUniqueNum(string ColumnName, string ColumnValue)
        //{
        //    return OCompletingCheckDAL.OCompletingCheck_GetCheckUniqueNum(ColumnName, ColumnValue);
        //}
    }
}
